<template>
	<view class="content">
		<view class="info-block">
			<view class="info-list" @click="navigate('/pages/supervise/detail')">
				<view class="title">书记督、督书记</view>
				<!-- <view class="text">"书记督、督书记、保落实"督查责任人</view> -->
			</view>
			<!-- <view class="info-list2" @click="navigate('/pages/supervise/supervise-detail')">
				<view class="title">督书记</view> -->
			<!-- <view class="text">"书记督、督书记、保落实"督查对象</view> -->
			<!-- </view> -->
			<!-- <view class="info-list1" @click="jump('/pages/supervise/secretary')">
				<view class="title">我的动态</view>
				<view class="text">"书记督、督书记、保落实"督查对象</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	import {
		getStorage
	} from '@/util/auth.js';
	import {
		getwhiteListApi
	} from '@/api/supervise.js'
	export default {
		data() {
			return {
				openIdList: [],
				openId: '',
				state: 0
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			jump(url) {
				let list = this.openIdList
				list.forEach((item, index) => {
					if (item.openid == this.openId) {
						this.state = 1
						uni.navigateTo({
							url
						})
					}
				})
				if (this.state == 0) {
					uni.showToast({
						title: '暂无权限',
						icon: 'none'
					})
				}
			},
			getList() {
				getwhiteListApi({}).then(res => {
					this.openIdList = res || [];
				}).catch(() => {
					uni.hideLoading()
				})
			}
		},
		onShow() {
			this.openId = getStorage('openId');
			this.getList()
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		height: 100%;
		min-height: 100vh;

		.info-block {
			padding: 30rpx;

			.info-list {
				padding: 30rpx;
				width: 100%;
				height: 320rpx;
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				box-shadow: 0 0 10px 0 #dedede;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: flex-start;
				background: url('https://gz.yshj.minshengjiandu.com/api/file/书记督.png') no-repeat center;
				background-size: 100% 100%;

				.title {
					font-size: 40rpx;
					color: #fff;
					margin-left: 20rpx;
				}

				.text {
					font-size: 30rpx;
					color: #fff;
					margin-top: 30rpx;
				}
			}

			.info-list1 {
				padding: 30rpx;
				width: 100%;
				height: 320rpx;
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				box-shadow: 0 0 10px 0 #dedede;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: flex-start;
				background: url('https://gz.yshj.minshengjiandu.com/api/file/督书记.png') no-repeat center;
				background-size: 100% 100%;

				.title {
					font-size: 40rpx;
					color: #fff;
					margin-left: 20rpx;
				}

				.text {
					font-size: 30rpx;
					color: #fff;
					margin-top: 30rpx;
				}
			}

			.info-list2 {
				padding: 30rpx;
				width: 100%;
				height: 320rpx;
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				box-shadow: 0 0 10px 0 #dedede;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: flex-start;
				background: url('https://gz.yshj.minshengjiandu.com/api/file/ed16f0e263d69.png') no-repeat center;
				background-size: 100% 100%;

				.title {
					font-size: 40rpx;
					color: #fff;
					margin-left: 20rpx;
				}

				.text {
					font-size: 30rpx;
					color: #fff;
					margin-top: 30rpx;
				}
			}
		}
	}
</style>